package com.spa.application.dto.admin;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spa.application.converter.*;
import lombok.Data;

import java.util.Date;

@Data
@JsonInclude
public class TicketExportDTO {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ExcelProperty(value = "ID")
    @ColumnWidth(20)
    private String id;

    @ExcelProperty(value = "优惠券名称")
    @ColumnWidth(20)
    private String name;

    @ExcelProperty(value = "优惠券类型")
    @ColumnWidth(20)
    private String type;

    @ExcelProperty(value = "最低消费金额",converter = AmountIntegerToYuanConverter.class)
    @ColumnWidth(20)
    private Integer threshold;

    @ExcelProperty(value = "优惠方式")
    @ColumnWidth(20)
    private String discountType;

    @ExcelProperty(value = "生效方式")
    @ColumnWidth(20)
    private String comeIntoForceType;

    @ExcelProperty(value = "有效期",converter = AddTianConverter.class)
    @ColumnWidth(20)
    private Integer expirationDate;

    @ExcelProperty(value = "发放总量")
    @ColumnWidth(15)
    private Integer quantityLimit;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "创建时间")
    @ColumnWidth(20)
    private Date createTime;

    @ExcelProperty(value = "是否下架",converter = IsDelConverter.class)
    @ColumnWidth(10)
    private Integer isDel;

    @ExcelProperty(value = "限制金额",converter = AmountIntegerToYuanConverter.class)
    @ColumnWidth(10)
    private Integer overflow;

    @ExcelProperty(value = "优惠券金额",converter = AmountIntegerToYuanConverter.class)
    @ColumnWidth(10)
    private Integer rmb;
}
